package com.tledu.web_01;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = "/stu/manager")
public class StuManagerServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        // 可以向request域中添加一些数据，这个数据可以在整个请求的方位内共享
        // 管理学生请求
        // 向请求域中添加了数据
        req.setAttribute("teacher", "cyrus");
        // 请求转发
        req.getRequestDispatcher("/stu").forward(req, resp);
    }
}
